package cz.techi;

import android.app.Activity;
import android.content.Intent;
import android.view.MenuItem;

public class MenuHandler {

	public static boolean handle(Activity context, MenuItem item)
	{
		Intent myIntent;
        switch (item.getItemId()) {
        case R.id.load:
        	
        	myIntent = new Intent(context, LoadActivity.class);
            context.startActivityForResult(myIntent, 0);
            return true;
        
        case R.id.schedule:
        	myIntent = new Intent(context, ScheduleActivity.class);
            context.startActivityForResult(myIntent, 0);
            return true;
            
        case R.id.preview:
        	myIntent = new Intent(context, PreviewActivity.class);
            context.startActivityForResult(myIntent, 0);
            return true;
        default:
            return context.onOptionsItemSelected(item);
        }
	}
}